/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package javafx179labs.nez.hr.util;

import javafx179labs.nez.hr.bean.ObjHashId;
import java.util.List;

/**
 *
 * @author civil
 */
public class GetFreeId<T> {
    List<T> list;

    public GetFreeId (List<T> list) {
        this.list = list;
    }

    public Integer get() {
        if (list == null) {
            return 0;
        } else {
            return ((ObjHashId)list.get(list.size() - 1)).getId() + 1;
        }
    }
}
